package com.wuyou.designPatterns.builder;

import com.wuyou.designPatterns.builder.framework.AbstractBuilder;
import com.wuyou.designPatterns.builder.framework.Document;

public class TextStringBuilder extends AbstractBuilder<Document> {

    private final Document document;

    private TextStringBuilder() {
        document = new Document();
    }

    public static AbstractBuilder<Document> getBuilder() {
        return new TextStringBuilder();
    }

    @Override
    public AbstractBuilder<Document> buildTitle(String title) {
        this.document.setTitle(title);
        return this;
    }

    @Override
    public AbstractBuilder<Document> buildContent(String content) {
        this.document.setContent(content);
        return this;
    }

    @Override
    public AbstractBuilder<Document> buildFoot(String foot) {
        this.document.setFoot(foot);
        return this;
    }

    @Override
    public com.wuyou.designPatterns.builder.framework.Document build() {
        return this.document;
    }
}
